Google App Engine
Learn how to deploy an application using Google App Engine.
We'll cover the following
gcloud - A command line tool#
Google also has a cloud platform that offers a large selection of features, from virtual machines to application hosting. Google App Engine is the platform that can host and execute your code directly, including Python and many other languages.
Google provides a command-line tool, like everyone else, called gcloud. It is rather straightforward to use and the online documentation is pretty complete in terms of how to deploy your WSGI application.
Deploying WSGI Python app#
There are only two files needed to deploy a WSGI Python application in the Google App Engine:
app.yamlwhich contains the application metadata and the address of the main module to run.- At least one Python file that contains the code to run. Obviously, it can be an entire Python module with subdirectories.
Once those files exist, you can directly deploy your WSGI application on Google
App Engine and access it using curl or browser.
Note: You need to have a Google account to deploy an app to Google App Engine. The Google cloud may offer a one year free tier, or you might need to pay to get your app deployed.
Steps to deploy an application#
Following are the steps needed to deploy a WSGI app to Google App Engine:
-
In the folder containing the app, enter command
gcloud app deploy. If you see an error that you are not logged in, then use the commandgcloud auth loginto login into a Google account. -
Enter
yto continue deploying.
Your application will be deployed!
You can access the application using command curl https://scapytest.appspot.com/. Use your own app URL provided when the application is deployed.
/
Like many of the other platforms, Google App Engine provides scalability features. In this case, it is automatic and there is nothing that has to be done if the traffic to the application increases.
Amazon Beanstalk
OpenShift